#include <stdio.h>
#include <stdlib.h>

#define kMaxSize 1001
typedef int Position; /* 整型下标，表示元素的位置 */
typedef struct StringNode *String;
struct StringNode {
    char data[kMaxSize]; /* 存储字符的数组 */
    int length; /* 字符串长度 */
};

String InitStr() {
    /* 初始化一个空的字符串 */
    String s;

    s = (String)malloc(sizeof(struct StringNode));
    s->length = 0;

    return s;
}

int min(int x, int y) {
    return (x < y) ? x : y;
}

/* 算法4-5：字符串比较操作  StrCompare(s,t) */
int StrCompare(String s, String t) {
    int len, ret;
    Position i;

    len = min(s->length, t->length);
    i = 0;
    while ((i < len) && (s->data[i] == t->data[i])) {
        i++; /* 顺次比较s和t等长的部分 */
    }
    if (i == len) { /* 等长部分都相等 */
        if (s->length > len) {
            ret = 1;
        } else if (t->length > len) {
            ret = -1;
        } else { /* s = t */
            ret = 0;
        }
    } /* 否则等长部分不相等 */
    else if (s->data[i] > t->data[i]) {
        ret = 1;
    } else {
        ret = -1;
    }
    return ret;
}
/* 算法4-4 结束 */

String ReadString() {
    Position i;
    String s;

    s = InitStr(); /* 创建空的字符串 */
    i = 0;
    s->data[i] = getchar();
    while (s->data[i] != '\n') {
        i++;
        s->data[i] = getchar();
    }
    s->data[i] = '\0'; /* 字符串结束符占1位 */
    s->length = i;
    return s;
}

int main(void) {
    String s, t;

    s = ReadString();
    t = ReadString();
    printf("%d\n", StrCompare(s, t));

    return 0;
}